package ui;

import android.content.Intent;
import android.os.Handler;
import android.os.HandlerThread;
import android.support.v7.app.AppCompatActivity;
import android.os.Bundle;
import android.view.TextureView;
import android.view.View;
import android.widget.Button;

import com.example.demon.cameratest.R;

public class MainActivity extends AppCompatActivity {

    private Button camera_intent_btn;
    private Button camera2_intent_btn;

    @Override
    protected void onCreate(Bundle savedInstanceState) {
        super.onCreate(savedInstanceState);
        setContentView(R.layout.activity_main);
        initView();
        initEvent();
    }

    private void initEvent() {
        camera_intent_btn.setOnClickListener(new View.OnClickListener() {
            @Override
            public void onClick(View v) {
                Intent intent = new Intent();
                intent.setClass(MainActivity.this , MCameraActivity.class);
                startActivity(intent);
            }
        });

        camera2_intent_btn.setOnClickListener(new View.OnClickListener() {
            @Override
            public void onClick(View v) {
                Intent intent = new Intent();
                intent.setClass(MainActivity.this , MCamera2Activity.class);
                startActivity(intent);
            }
        });
    }

    private void initView() {
        camera_intent_btn = (Button)findViewById(R.id.camera_intent_btn);
        camera2_intent_btn = (Button)findViewById(R.id.camera2_intent_btn);
    }


}
